Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Textures

As indicated earlier, QuickDraw 3D supports texture shaders that allow you to perform texture mapping, a technique wherein a predefined image (the texture) is mapped onto the surface of an object in a model. For instance, you can create a wood-grain image and map it onto objects in a model to give those objects a wooden appearance. Similarly, you can digitize an image of a person and apply it, using a texture shader, to the face of an object to create a picture, in the model, of that person. In general, you'll use texture shaders to create realistic-looking surfaces (such as wood, stone, or cloth) in your models.

You create a texture shader by calling Q3TextureShader_New , passing it a texture object (or, more briefly, a texture ). QuickDraw 3D provides a number of functions that you can use to create and manipulate texture objects. Currently QuickDraw 3D supports one subclass of texture objects, pixmap texture objects, which are images defined by pixmaps. You call Q3PixmapTexture_New to create a new texture object from a pixmap.

See the chapter "Geometric Objects" for information on pixmaps.

Once you've created a texture from a pixmap, you need to attach the texture to surfaces in your model. See "Using Texture Shaders" for details.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |